import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';

export const routes: RouteRecordRaw[] = [ {
  path: '/login',
  component: () => import('../../views/login/login.vue'),
  meta: { hidden: true },
  name: "登陆",
}];

routes.push(
  {
    path: '/Model',
    redirect: '/Model/index',
    component: () => import('../../components/HelloWorld.vue'),
    name: "选择模型",
    children: [
      {
        path: '/Model/index',
        component: () => import('../../views/Model/ModelIndex.vue'),
        meta: { title: '菜单', requireAuth: true, affix: true, closable: false },
        name: "模型",
      },
    ]
  },
  
 
  {
    path: '/Predict',
    redirect: '/Predict/index',
    component: () => import('../../components/HelloWorld.vue'),
    meta: { title: '预测' },
    name: "预测流量",
    children: [
      {
        path: '/Predict',
        name: '预测',
        component: () => import('../../views/Predict/PredictIndex.vue'),
        meta: { title: '菜单', requireAuth: true, affix: true, closable: false },
      }
    ]
  },
  {
    path: '/Detect',
    redirect: '/Detect/index',
    meta: { title: '异常检测' },
    component: () => import('../../components/HelloWorld.vue'),
    name: "异常检测",
    children: [
      {
        path: '/Detect',
        name: '异常检测',
        component: () => import('../../views/Detect/DetectIndex.vue'),
        meta: { title: '用户' },
      }]
  },
)

//创建路由，并且暴露出去
const router = createRouter({
  history: createWebHashHistory(), //开发环境
  //history:createWebHistory(), //正式环境
  routes
})
export default router



